package tool;

import java.io.InputStream;

public class GFileUtil {

	public static String getFileInString(InputStream in)
	{
		int len=0;
		byte[]tmp=new byte[20480];
		byte[] data=null;
		String value = null;
		try {
			while(true){
				int c = in.read();
				if(c==-1)break;
				else tmp[len++]=(byte)c;
			}
			data = new byte[len];
			System.arraycopy(tmp, 0, data, 0, len);
			value = new String(data, "gb2312");
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		finally{
			tmp = null;
			data = null;
		}
		return value;
	}
	
}
